package com.youlu.campus.entity.form;

import com.youlu.campus.base.base.EntityBase;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.ArrayList;
import java.util.List;

/**
 * 单个表单项配置
 */
@Getter
@Setter
@Document(collection = "single_form_config")
public class SingleFormQuestion extends EntityBase {
    @Indexed
    private String formTaskConfigId;
    /**
     * 序号
     */
    @Indexed
    private Integer no;
    /**
     * 表单项标题
     */
    private String title;
    /**
     * 表单项图片
     */
    private String imageUrl;
    /**
     * 表单项详情
     */
    private String detail;
    /**
     * 类型，
     * single-choice:单选题
     * multiple-choice:多项选择题
     * text-box:文本框
     * file-upload:文件上传
     * image-upload:图片上传
     * video-upload:视频上传
     * number-box:数字输入框
     * date-box:数字输入框
     */
    private String type;
    /**
     * 是否必选
     */
    private Boolean required = Boolean.FALSE;
    /**
     * 是否有标准答案
     */
    private Boolean hasStandardAnswer = Boolean.FALSE;
    /**
     * 值的类型
     * INT:数字
     * DATE:日期
     * STRING:字符串
     */
    private String valueType;
    /**
     * 数量
     */
    private Integer taskCount = 1;
    @Transient
    private List<SingleFormAnswer> answers = new ArrayList<>();
}
